#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/bug.class.php';
su('admin');

/**

title=bugModel->getBugQuery();
cid=1
pid=1

查询 `product` = 'all' 的bugQuery >> 1 AND `product` IN ('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50','51','52','53','54','55','56','57','58','59','60','61','62','63','64','65','66','67','68','69','70','71','72','73','74','75','76','77','78','79','80','81','82','83','84','85','86','87','88','89','90','91','92','93','94','95','96','97','98','99','100','101','102','103','104','105','106','107','108','109','110','111','112','113','114','115','116','117','118','119','120','1','2','3','4','5','6','7','8','9','10','21','22','23','24','25','26','27','28','29','30','41','42','43','44','45','46','47','48','49','50','61','62','63','64','65','66','67','68','69','70','81','82','83','84','85','86','87','88','89','90','101','102','103','104','105','106','107','108','109','110
查询 `project` = 'all' 的bugQuery >> 1 AND `project` in (11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,731,732,733,734,735,736,737,738,739,740,741,742,743,744,745,746,747,748,749,750)
查询 `resolvedDate` = '2022-01-01' 的bugQuery >>  `resolvedDate` != '0000-00-00 00:00:00' AND `resolvedDate` > '2022-01-01'
查询 `closedDate` = '2022-01-01' 的bugQuery >>  `closedDate` != '0000-00-00 00:00:00' AND `closedDate` <= '2022-01-01'
查询 `story` LIKE '%abc%' 的bugQuery >>  `story`  IN (2,12,20,21,22,23,24,25,26,27,28,29,32,42,52,62,70,71,72,73,74,75,76,77,78,79,82,92,102,112,120,121,122,123,124,125,126,127,128,129,132,142,152,162,172,182,192,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,302,312,320,321,322,323,324,325,326,327,328,329,332,342,352,362,372,382,392,402,412,420,421,422,423,424,425,426,427,428,429,432,442) AND `story` != 0
查询 `story` NOT LIKE '%abc%' 的bugQuery >>  `story` NOT  IN (2,12,20,21,22,23,24,25,26,27,28,29,32,42,52,62,70,71,72,73,74,75,76,77,78,79,82,92,102,112,120,121,122,123,124,125,126,127,128,129,132,142,152,162,172,182,192,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,302,312,320,321,322,323,324,325,326,327,328,329,332,342,352,362,372,382,392,402,412,420,421,422,423,424,425,426,427,428,429,432,442) AND `story` != 0
查询 `product` = '1' and `project` = '1' and `story` > 'abc' 的bugQuery >> `product` = '1' and `project` = '1' and `story` > 'abc' AND `story` != 0

*/

$bugQuery = array();
$bugQuery[] = "`product` = 'all'";
$bugQuery[] = "`project` = 'all'";
$bugQuery[] = " `resolvedDate` > '2022-01-01'";
$bugQuery[] = " `closedDate` <= '2022-01-01'";
$bugQuery[] = " `story` LIKE '%2%'";
$bugQuery[] = " `story` NOT LIKE '%2%'";
$bugQuery[] = " `product` = '1' and `project` = '1' and `story` > 'abc'";

$bug=new bugTest();

r($bug->getBugQueryTest($bugQuery[0])) && p()  && e("1 AND `product` IN ('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50','51','52','53','54','55','56','57','58','59','60','61','62','63','64','65','66','67','68','69','70','71','72','73','74','75','76','77','78','79','80','81','82','83','84','85','86','87','88','89','90','91','92','93','94','95','96','97','98','99','100','101','102','103','104','105','106','107','108','109','110','111','112','113','114','115','116','117','118','119','120','1','2','3','4','5','6','7','8','9','10','21','22','23','24','25','26','27','28','29','30','41','42','43','44','45','46','47','48','49','50','61','62','63','64','65','66','67','68','69','70','81','82','83','84','85','86','87','88','89','90','101','102','103','104','105','106','107','108','109','110')"); // 查询 `product` = 'all' 的bugQuery
r($bug->getBugQueryTest($bugQuery[1])) && p()  && e("1 AND `project` in (11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,731,732,733,734,735,736,737,738,739,740,741,742,743,744,745,746,747,748,749,750)"); // 查询 `project` = 'all' 的bugQuery
r($bug->getBugQueryTest($bugQuery[2])) && p()  && e(" `resolvedDate` != '0000-00-00 00:00:00' AND `resolvedDate` > '2022-01-01'"); // 查询 `resolvedDate` = '2022-01-01' 的bugQuery
r($bug->getBugQueryTest($bugQuery[3])) && p()  && e(" `closedDate` != '0000-00-00 00:00:00' AND `closedDate` <= '2022-01-01'");    // 查询 `closedDate` = '2022-01-01' 的bugQuery
r($bug->getBugQueryTest($bugQuery[4])) && p()  && e(" `story`  IN (2,12,20,21,22,23,24,25,26,27,28,29,32,42,52,62,70,71,72,73,74,75,76,77,78,79,82,92,102,112,120,121,122,123,124,125,126,127,128,129,132,142,152,162,172,182,192,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,302,312,320,321,322,323,324,325,326,327,328,329,332,342,352,362,372,382,392,402,412,420,421,422,423,424,425,426,427,428,429,432,442) AND `story` != 0"); // 查询 `story` LIKE '%abc%' 的bugQuery
r($bug->getBugQueryTest($bugQuery[5])) && p()  && e(" `story` NOT  IN (2,12,20,21,22,23,24,25,26,27,28,29,32,42,52,62,70,71,72,73,74,75,76,77,78,79,82,92,102,112,120,121,122,123,124,125,126,127,128,129,132,142,152,162,172,182,192,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,302,312,320,321,322,323,324,325,326,327,328,329,332,342,352,362,372,382,392,402,412,420,421,422,423,424,425,426,427,428,429,432,442) AND `story` != 0"); // 查询 `story` NOT LIKE '%abc%' 的bugQuery
r($bug->getBugQueryTest($bugQuery[6])) && p()  && e("`product` = '1' and `project` = '1' and `story` > 'abc' AND `story` != 0");   // 查询 `product` = '1' and `project` = '1' and `story` > 'abc' 的bugQuery